﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace Syfuhs.APIWrappers.LiveMeeting
{
    public class LiveMeetingConferenceCenterProviders : List<LiveMeetingConferenceCenterProvider>
    {
        public LiveMeetingConferenceCenterProviders() { }

        public static LiveMeetingConferenceCenterProviders ParseProviders(XmlNodeList providers)
        {
            LiveMeetingConferenceCenterProviders prov = new LiveMeetingConferenceCenterProviders();

            foreach (XmlNode p in providers)
            {
                LiveMeetingConferenceCenterProvider pr = (LiveMeetingConferenceCenterProvider)
                    TypeParser.ParseXmlNodes(new LiveMeetingConferenceCenterProvider(), p.SelectNodes("OptionList"));

                bool enabled = false;

                if (bool.TryParse(p.Attributes["enabled"].Value, out enabled))
                {
                    pr.Enabled = enabled;
                }

                pr.Name = p.Attributes["name"].Value;

                prov.Add(pr);
            }

            return prov;
        }
    }

    public class LiveMeetingConferenceCenterProvider : ParsedType
    {
        public string Name { get; set; }

        public bool Enabled { get; set; }

        public bool EcrWebPagePrivilegeDefault { get; set; }

        public bool EcrScreenSnapshotPrivilegeDefault { get; set; }

        public bool EcrPollPagePrivilegeDefault { get; set; }

        public bool EcrUploadSlidesPrivilegeDefault { get; set; }

        public double ProvidesSip { get; set; }

        public string DomainName { get; set; }

        public string SampleDialingKeysPre { get; set; }

        public string SampleDialingKeysPost { get; set; }

        public string CspSupportsEjectAllExcept { get; set; }

        public string CspExtraProperties2 { get; set; }

        public string CspExtraProperties1 { get; set; }

        public string CspSupportsReconciliation { get; set; }

        public string CspSupportsPlaybackName { get; set; }

        public string CspExtraProperties9 { get; set; }

        public string CspExtraProperties7 { get; set; }

        public string CspSupportsEjectLine { get; set; }

        public string CspExtraProperties8 { get; set; }

        public string CspSupportsAnnounceOptions { get; set; }

        public string CspExtraProperties5 { get; set; }

        public string CspSupportsMultipleLeaders { get; set; }

        public string CspExtraProperties6 { get; set; }

        public string CspExtraProperties3 { get; set; }

        public string CspExtraProperties4 { get; set; }

        public string CspSupportsLockConference { get; set; }

        public string CspSupportsCallOut { get; set; }

        public string CspSupportsNameRecording { get; set; }

        public string CspSupportsMuteLine { get; set; }

        public string CspSupportsMuteAllExcept { get; set; }

        public override string ToString()
        {
            return this.Name;
        }
    }
}
